package com.cxytiandi.sjdbc.repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;

import com.cxytiandi.sjdbc.po.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;


public interface UserRepository {
	
	Long addUser(User user);
	
	List<User> list();

	int updateBatchSubtractVO(@Param("list") List<User> list);

	int updateBatchSubtractVOMap(@Param("list") List<Map<String,Integer>> list);

	int updateBatchSubtractVOMapNew(@Param("list") List<Map<String,Object>> list);

	int updateBatch(@Param("map") Map map);

	int updateBatchNew(@Param("map") Map map);

	@Update("update user SET user_count = user_count +#{userCount}, user_point = user_point +#{userPoint} where id = #{id}")
	int updateBatchSubtractVONew(@Param("id") Long id, @Param("userCount") Integer userCount,
								 @Param("userPoint") Integer userPoint);

	int insertBatch(@Param("list") List<User> list);
	
}
